<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib tagdir="/WEB-INF/tags/" prefix="util" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="core" %>
<util:template titulo="ListaUsuario">
    <div class="container">
        <div class="navbar navbar-default" role="navigation">
            <div class="navbar-header">
                <a class="navbar-brand" href="${baseURL}/intranet/usuario/listar">Lista de usuarios</a>
            </div>
            <form class="navbar-form navbar-right" method="post" role="search"  action="${baseURL}/intranet/usuario/listar">
                <div class="form-group">
                    <input type="text" class="form-control" name="filtro" value="${filtrousuario}"  placeholder="Buscar">
                </div>
                <button type="submit" class="btn btn-default">Filtrar</button>
            </form>
        </div>
        <div class="table-responsive">
            <table class="table table-striped table-hover table-bordered">
                <tr>
                    <th style="width: 220px;" class="hidden-xs">Foto</th>
                    <th>Login</th>
                    <th>Nome</th>
                    <th>Sobrenome</th>
                    <th>E-mail</th>
                    <th style="width: 110px;">Ações</th>
                </tr>
                <c:if test="${empty usuarios}">
                    <tr><td colspan="6">A lista está vazia</td></tr>
                </c:if>
                <c:if test="${not empty usuarios}">
                    <c:forEach items="${usuarios}" var="usuario">
                        <tr>
                            <td  class="hidden-xs" ><img class="img-thumbnail img-responsive" src='${usuario.caminhoFoto}' style="max-width: 200px;"></td>
                            <td>${usuario.login}</td>
                            <td>${usuario.nome}</td>
                            <td>${usuario.sobrenome}</td>
                            <td>${usuario.email}</td>
                            <td>
                                <div class="btn-group">
                                    <a class="btn btn-primary" href="intranet/usuario/editar?id=${usuario.id}"><i class="glyphicon glyphicon-edit"></i></a>
                                    <a class="btn btn-danger" href="intranet/usuario/excluir?id=${usuario.id}"><i class="glyphicon glyphicon-trash"></i></a>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                </c:if>
            </table>
        </div>
        <a class="btn btn-lg btn-primary pull-right" href="intranet/usuario/incluir"><i class="glyphicon glyphicon-plus-sign"></i> Incluir novo usu&aacute;rio</a>
    </div>
</util:template>